package com.cheng.reggie.mapper;

import com.cheng.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {

    //插入一条订单数据
    @Insert("insert into  orders values(#{id},#{number},#{status},#{userId}," +
            "#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod}," +
            "#{amount},#{remark},#{phone},#{address},#{userName},#{consignee}) ")
    void  sava(Orders orders);

    //查询用户订单所有数据
    @Select("select * from orders where user_id=#{uid} order by order_time desc ")
    List<Orders> findByUid(Long uid);
}
